1 00:00:00,170 --> 00:00:05,600 To get started with the next section of our story, we're going to have to listen for when our basement 2 00:00:05,600 --> 00:00:06,770 part gets touched. 3 00:00:06,770 --> 00:00:11,720 When it does, we'll teleport all the players to the basement and start the cutscene for the stairs. 4 00:00:11,720 --> 00:00:13,400 So let's get started. 5 00:00:13,400 --> 00:00:18,380 We're going to be scripting in a total of five module scripts here, so you're going to want to make 6 00:00:18,380 --> 00:00:19,790 sure you get all of these open. 7 00:00:19,790 --> 00:00:24,020 For example, you want to open up the game service that is inside of your server script service. 8 00:00:24,020 --> 00:00:26,210 Inside of your services folder. 9 00:00:26,210 --> 00:00:31,070 You're going to want to open up the game sections module script that is inside of the module section, 10 00:00:31,070 --> 00:00:32,480 and the service script service. 11 00:00:32,480 --> 00:00:36,980 You're going to want to also open up your handsome Squidward Animate module script, which is also in 12 00:00:36,980 --> 00:00:39,200 the modules folder in the Squidward folder. 13 00:00:39,200 --> 00:00:43,130 And then you also want to open up the game handler on the client. 14 00:00:43,130 --> 00:00:45,230 So that's in Starter Player scripts. 15 00:00:45,230 --> 00:00:49,820 You'll open up the game handler, and we're also going to open up the game scenes module script in the 16 00:00:49,820 --> 00:00:51,800 modules section on the client. 17 00:00:51,950 --> 00:00:54,680 So to get started we're going to go to our game service. 18 00:00:54,680 --> 00:00:58,190 And we're going to listen for when our basement part gets touched. 19 00:00:58,190 --> 00:01:02,540 The first thing we need to verify is if we're ready for section number two. 20 00:01:02,570 --> 00:01:07,490 If we are not ready for section two, then we do not care about our basement part getting touched. 21 00:01:07,490 --> 00:01:09,350 So we're just going to return. 22 00:01:09,350 --> 00:01:12,500 We're also going to get the part that touched this part. 23 00:01:12,500 --> 00:01:16,970 And we still want to verify whether or not a character or a player touched this part. 24 00:01:16,970 --> 00:01:17,570 Right? 25 00:01:17,570 --> 00:01:24,170 So if not other part dot parent find first child which is a humanoid, then we're going to return. 26 00:01:24,170 --> 00:01:29,480 And basically we could actually just copy the exact same thing that we did up here to make sure that 27 00:01:29,480 --> 00:01:31,790 a player has touched our basement part. 28 00:01:31,790 --> 00:01:36,170 After that, we can create a boolean to keep track of when this part gets touched. 29 00:01:36,170 --> 00:01:38,720 So that way we don't execute this function more than once. 30 00:01:38,720 --> 00:01:43,490 So we'll create a new boolean up here and we'll call it basement touched. 31 00:01:43,490 --> 00:01:45,290 And we'll set that to false for now. 32 00:01:45,680 --> 00:01:52,280 And we can go back and check if basement touched then we're just going to return. 33 00:01:52,670 --> 00:01:55,970 Otherwise we can set basement touch equal to true. 34 00:01:56,060 --> 00:02:02,120 And afterwards we can refer to our sections module script and start our section number two. 35 00:02:02,450 --> 00:02:07,250 So hopping into our game sections module script, we're now going to start scripting inside of this 36 00:02:07,250 --> 00:02:07,910 function. 37 00:02:08,330 --> 00:02:14,660 What we can do in here is we can leave out a warning message to say starting section two of the game. 38 00:02:15,890 --> 00:02:20,150 And then we're going to use our game comms event, and we're going to fire to all of the clients in 39 00:02:20,150 --> 00:02:27,440 our game that we need them to change their sound into the basement so we can do game comms enum for 40 00:02:27,440 --> 00:02:31,880 the client to client, and we want to change their sound to the basement. 41 00:02:31,880 --> 00:02:36,230 That way any sounds that are outside or in the restaurant are going to be muffled. 42 00:02:36,230 --> 00:02:40,790 Then we're going to use the game comms event again and fire to all of the clients that we need them 43 00:02:40,790 --> 00:02:42,650 to start the stairs scene. 44 00:02:42,650 --> 00:02:50,720 So game comms enum on the client two client and there is a scene for us to start, which is the stairs 45 00:02:50,720 --> 00:02:51,260 scene. 46 00:02:51,940 --> 00:02:54,340 So inside of our game handler module script. 47 00:02:54,340 --> 00:02:59,020 As you can see, when we're given the action to start the stair scene, this is where we're going to 48 00:02:59,020 --> 00:03:04,600 use the scenes module script on the client to start the animation for the stair scene, and we can go 49 00:03:04,600 --> 00:03:08,140 ahead and fill it out real quick, because it's actually not that complicated. 50 00:03:08,140 --> 00:03:12,940 All we're going to do when we need to start our stair scene is we want to first make sure that the player 51 00:03:12,940 --> 00:03:14,950 isn't on the dead team. 52 00:03:14,950 --> 00:03:18,460 So what we could do is we could get access to the team service up here. 53 00:03:18,490 --> 00:03:20,650 Game get service teams. 54 00:03:21,970 --> 00:03:30,010 And if our local player team is equal to the team's dead, then we're just going to ignore this command. 55 00:03:30,130 --> 00:03:36,670 Otherwise, we're going to set the current camera camera type equal to the enum dot camera type dot 56 00:03:36,670 --> 00:03:37,570 scriptable. 57 00:03:37,660 --> 00:03:42,250 And then we're going to use our tween service and create a tween on our camera. 58 00:03:42,520 --> 00:03:49,480 We can do a tween info dot new of like one second and an enemy's style of let's say sine. 59 00:03:50,310 --> 00:03:54,360 And we're going to want to move the C frame of our camera. 60 00:03:55,080 --> 00:03:58,140 And that C frame is going to be equal to a part in the workspace. 61 00:03:58,140 --> 00:04:02,760 So in the workspace dot filtering folder we can get our camera parts folder. 62 00:04:02,760 --> 00:04:06,120 And we have a part in there called facing the stairs. 63 00:04:06,120 --> 00:04:08,730 And then we can get the C frame of that part. 64 00:04:08,910 --> 00:04:10,800 Now we can go ahead and play this tween. 65 00:04:10,800 --> 00:04:13,680 And that's all we need to do for the stair scene. 66 00:04:13,680 --> 00:04:14,370 That's it. 67 00:04:14,920 --> 00:04:18,100 So we can go back into our game sections module script. 68 00:04:18,100 --> 00:04:24,850 And another thing we'll want to have the clients do is to play the ambience inside of the basement. 69 00:04:24,850 --> 00:04:27,640 So game comms event fire to all the clients. 70 00:04:27,640 --> 00:04:32,980 Again we're going to use the game comms enum client to client dot play sound. 71 00:04:33,310 --> 00:04:37,300 And the sound instance is going to be inside of the sound service dot ambience. 72 00:04:37,300 --> 00:04:39,820 And there is the basement ambience. 73 00:04:39,820 --> 00:04:41,740 So I'll play that real quick for you. 74 00:04:41,770 --> 00:04:44,080 We'll go to the basement ambience and we'll play this. 75 00:04:49,390 --> 00:04:55,270 So it's going to be a creepy kind of intense ambience that we're going to be playing inside of the basement. 76 00:04:56,110 --> 00:05:01,270 And of course we can set play at point equal to false. 77 00:05:02,280 --> 00:05:05,910 And now what we're going to do is we're going to loop through every single player that is inside of 78 00:05:05,910 --> 00:05:06,900 our alive team. 79 00:05:06,900 --> 00:05:13,950 So in teams dot alive, get players, we want to go ahead and teleport them around a specific point 80 00:05:13,950 --> 00:05:16,710 so we can use our teleport player around keyframe function. 81 00:05:16,710 --> 00:05:18,480 We're going to pass this player. 82 00:05:18,480 --> 00:05:24,780 And then inside of the workspace dot filtering folder inside of the teleport parts folder, there is 83 00:05:24,780 --> 00:05:27,480 our basement part, and we're going to get the keyframe of that. 84 00:05:27,690 --> 00:05:31,710 So when we go to our basement, here's our part. 85 00:05:31,710 --> 00:05:36,720 We're just going to teleport our players randomly around this part four studs this way or four studs 86 00:05:36,720 --> 00:05:39,780 that way, four studs that way and four studs this way. 87 00:05:39,780 --> 00:05:43,770 So that way they should all be grouped up around this general area here. 88 00:05:44,070 --> 00:05:47,850 And after we do that, we want to stop the players from being able to exit the basement. 89 00:05:47,850 --> 00:05:53,910 So inside of the workspace dot filtering folder, there is a part in there called stairs blocking wall. 90 00:05:53,910 --> 00:05:56,520 And we're going to set the can collide for that equal to true. 91 00:05:56,520 --> 00:06:01,920 So if we actually go to our filtering folder and we find the stairs blocking wall, here it is. 92 00:06:01,920 --> 00:06:07,020 This part is going to prevent our players from being able to climb up the stairs and leave the basement 93 00:06:07,020 --> 00:06:07,740 afterwards. 94 00:06:07,740 --> 00:06:12,720 What we're going to do is we're going to refer to our Squidward that we're just going to animate so 95 00:06:12,720 --> 00:06:14,640 we can call it animate Squidward. 96 00:06:15,800 --> 00:06:18,710 And he's inside of the server storage. 97 00:06:18,950 --> 00:06:23,690 Other stuff folder and he is the handsome Squidward anime and not the AI. 98 00:06:23,690 --> 00:06:26,960 And we're going to go ahead and put him inside of the workspace. 99 00:06:26,960 --> 00:06:30,890 So we're going to set his parent equal to the workspace, and we can just put him in the characters 100 00:06:30,890 --> 00:06:31,550 folder. 101 00:06:32,090 --> 00:06:36,380 So he's going to be positioned right above here, and his eyes are going to be glowing. 102 00:06:36,380 --> 00:06:39,440 And that's when we tween the players camera to this position here. 103 00:06:39,440 --> 00:06:41,060 He's going to push this box. 104 00:06:41,060 --> 00:06:44,060 And this box is going to crush these stairs and destroy them. 105 00:06:44,060 --> 00:06:48,500 And they're going to see him standing in the background all animated with his eyes glowing. 106 00:06:48,650 --> 00:06:54,110 So when we go to server storage and go to other stuff and we find handsome Squidward Animate and we 107 00:06:54,110 --> 00:06:58,220 go ahead and set his parent equal to the workspace, he's going to be standing right back here with 108 00:06:58,220 --> 00:06:59,060 his eyes glowing. 109 00:06:59,090 --> 00:07:03,890 Of course the lights are going to be off, so the only thing you'll see is his face, so we can go ahead 110 00:07:03,890 --> 00:07:07,400 and move him back inside of server storage. 111 00:07:07,400 --> 00:07:09,890 So put him back in the other stuff folder. 112 00:07:10,580 --> 00:07:15,650 Because we're actually going to need to animate the Squidward, and the only animation we're going to 113 00:07:15,650 --> 00:07:18,650 need to do on him is just his idling animation. 114 00:07:18,650 --> 00:07:23,270 And we actually have a module script, which is our handsome Squidward animate that we're going to use 115 00:07:23,270 --> 00:07:25,340 to start and stop the animations on him. 116 00:07:25,930 --> 00:07:32,470 So inside of here, all we're going to do is refer to the server storage equal to game get service server 117 00:07:32,470 --> 00:07:33,370 storage. 118 00:07:34,090 --> 00:07:36,760 We'll have a table to represent this module script. 119 00:07:36,760 --> 00:07:39,550 So animation handler is equal to a table. 120 00:07:39,550 --> 00:07:42,520 And we'll make sure to return that at the end of our script. 121 00:07:43,710 --> 00:07:49,170 And inside of here we can have a function and animation handler to start his animation. 122 00:07:49,740 --> 00:07:53,940 And then we can have a function to stop his animation as well. 123 00:07:56,280 --> 00:08:00,720 We're going to want to make a reference to him so we can call it handsome. 124 00:08:01,950 --> 00:08:06,510 Squidward for animation is equal to server storage. 125 00:08:06,660 --> 00:08:07,710 Other stuff. 126 00:08:07,980 --> 00:08:08,370 Handsome. 127 00:08:08,370 --> 00:08:08,850 Squidward. 128 00:08:08,850 --> 00:08:09,480 Animate. 129 00:08:11,130 --> 00:08:14,850 And then we can get his idle animation, which is inside of handsome squid. 130 00:08:14,850 --> 00:08:18,900 Word for animate animations dot idle animation. 131 00:08:18,930 --> 00:08:24,240 So if you go into the server storage and you go to your handsome Squidward Animate, he has a folder 132 00:08:24,240 --> 00:08:29,610 with his idle animation and basically the only ID you need to copy in here is the exact same one that 133 00:08:29,610 --> 00:08:33,510 you put in for your handsome Squidward AI when we initially set up the game. 134 00:08:33,510 --> 00:08:39,270 If you haven't uploaded the animations yet, make sure you put him in the workspace and you open up 135 00:08:39,270 --> 00:08:44,040 the animation editor on him and load all of the different animations and publish them to Roblox. 136 00:08:44,040 --> 00:08:48,900 And then you can copy their IDs and put them inside of the different animation instances. 137 00:08:49,530 --> 00:08:55,230 Underneath his animation script, and then you can take the same idalene animation and put it inside 138 00:08:55,230 --> 00:08:58,170 of the idle animation for our handsome Squidward anime. 139 00:08:58,860 --> 00:09:01,650 Then we can go ahead and get the track for this idle animation. 140 00:09:01,650 --> 00:09:07,710 So idle track is equal to the handsome Squidward for annum dot humanoid dot animator. 141 00:09:07,710 --> 00:09:10,680 And we're going to load the animation idle anim. 142 00:09:12,110 --> 00:09:13,790 And then this is really easy. 143 00:09:13,820 --> 00:09:16,790 We'll just refer to our idle track and then play it here. 144 00:09:16,790 --> 00:09:21,440 And then down here we'll just refer to our idle track and then stop it here. 145 00:09:22,030 --> 00:09:24,310 And that's all we need to do for this module script. 146 00:09:24,670 --> 00:09:26,650 So now we can go back to our game sections. 147 00:09:26,650 --> 00:09:31,960 And what we could do here is we could refer to this module script, which means we're going to have 148 00:09:31,960 --> 00:09:33,670 to require it first of all. 149 00:09:34,410 --> 00:09:36,330 So up here we can create a variable. 150 00:09:36,330 --> 00:09:40,440 We'll call it Squidward Animation Handler. 151 00:09:40,440 --> 00:09:47,640 And that's going to be equal to the table that we get inside of server script service, dot server, 152 00:09:47,640 --> 00:09:54,060 dot modules, dot Squidward, and then we get the handsome Squidward animate. 153 00:09:54,060 --> 00:10:00,120 And now that we have this table, we can go down here and refer to our Squidward animation handler and 154 00:10:00,120 --> 00:10:02,190 we can start his animation. 155 00:10:02,190 --> 00:10:07,890 And now the next thing we need to do is while our players cameras are staring down at the stairs, we 156 00:10:07,890 --> 00:10:13,050 want to refer to a crate in the workspace that's going to be pushed so we can make a variable called 157 00:10:13,050 --> 00:10:16,770 crate, and that's equal to the workspace dot Krusty Krab. 158 00:10:16,770 --> 00:10:18,960 And we're going to get the pushed crate. 159 00:10:18,960 --> 00:10:25,590 And inside of this pushed crate we have a particle emitter that we're going to emit particles out of 160 00:10:25,590 --> 00:10:28,650 on each of these stair parts that we destroy. 161 00:10:28,650 --> 00:10:32,610 And we also have a light inside of this crate just to make sure it's easier to see, because it's going 162 00:10:32,610 --> 00:10:33,720 to be pitch black up here. 163 00:10:33,720 --> 00:10:36,480 So we actually want them to see this crate being pushed down. 164 00:10:36,840 --> 00:10:42,630 But basically we're going to emit like 60 particles out of each of these stair instances. 165 00:10:42,630 --> 00:10:43,200 That gets hit. 166 00:10:43,200 --> 00:10:47,100 So we'll emit something like that to show like broken particles flying off. 167 00:10:47,830 --> 00:10:49,900 Though, we'll make our reference to the push crate. 168 00:10:50,110 --> 00:10:56,290 And what we're going to do is we're going to connect to the touched event of this crate so we can call 169 00:10:56,290 --> 00:10:59,950 it connection, and it's equal to the crate dot touched event. 170 00:11:00,700 --> 00:11:04,480 And we're going to connect a Lambda function to this and get the other part that touched it. 171 00:11:04,480 --> 00:11:08,380 And we want to make sure that this other part has a name of stair step. 172 00:11:08,380 --> 00:11:11,530 So each one of these stairs has a name stair step. 173 00:11:11,530 --> 00:11:15,010 And if this box touches one of those we want to destroy it. 174 00:11:15,310 --> 00:11:22,210 So if this other part dot name is not equal to stair step. 175 00:11:23,040 --> 00:11:25,650 Then all we're going to do is just return out of the function. 176 00:11:25,650 --> 00:11:31,380 Otherwise what we could do is we could set this other part, transparency equal to one to make it invisible, 177 00:11:31,380 --> 00:11:35,940 set the other part can collide equal to false. 178 00:11:36,090 --> 00:11:40,230 And then we can get a clone of the particle emitter inside of the crate. 179 00:11:40,230 --> 00:11:48,300 So crate dot particle emitter will clone this and set the parent of the clone equal to the other part. 180 00:11:48,830 --> 00:11:54,830 And then we're going to use the game comms event and fire to all the clients to play a sound. 181 00:11:54,830 --> 00:11:59,630 So game comms client to client play sound. 182 00:11:59,660 --> 00:12:03,230 The sound instance is going to be inside of the sound service. 183 00:12:03,470 --> 00:12:05,150 SFX dot would break. 184 00:12:05,150 --> 00:12:07,400 So this is the sound we're going to play when the wood breaks. 185 00:12:07,400 --> 00:12:09,170 And I'll just play it real quick for you. 186 00:12:09,200 --> 00:12:10,280 Sounds like this. 187 00:12:11,480 --> 00:12:12,470 There we go. 188 00:12:12,470 --> 00:12:18,440 And then once we do that, we can refer to our clone and emit something like 60 particles out of it. 189 00:12:18,440 --> 00:12:21,740 Once we do this, we're going to wait something just like two seconds. 190 00:12:21,740 --> 00:12:26,270 So that way, once the player's camera stare down at the stairs, they're going to be staring for about 191 00:12:26,270 --> 00:12:26,870 two seconds. 192 00:12:26,870 --> 00:12:31,070 And then after those two seconds, we're going to push that crate down the stairs. 193 00:12:31,070 --> 00:12:35,240 So we're going to have to get our crate and make it unanchored. 194 00:12:35,240 --> 00:12:37,130 So anchored is equal to false. 195 00:12:37,130 --> 00:12:42,410 And we're also going to set the network ownership of the crate to the server. 196 00:12:42,410 --> 00:12:46,940 So we pass nothing to this function, because we want the server to have network ownership over the 197 00:12:46,940 --> 00:12:47,630 crate. 198 00:12:47,630 --> 00:12:51,710 And then we're going to refer to the crates dot assembly linear velocity. 199 00:12:51,710 --> 00:12:54,260 And this is how we're going to be able to throw it. 200 00:12:54,260 --> 00:12:59,750 And we want to set this assembly linear velocity equal to a new vector three which represents the direction 201 00:12:59,750 --> 00:13:01,910 of the force we want to push it towards. 202 00:13:01,910 --> 00:13:04,400 The higher the number then the greater the force. 203 00:13:04,400 --> 00:13:10,010 In our example, since the x axis is going this way, right? 204 00:13:10,010 --> 00:13:15,800 We want to push this crate in this direction which is going in the negative x direction. 205 00:13:15,800 --> 00:13:16,880 So. 206 00:13:17,670 --> 00:13:22,800 We can pass a value of like -30 to push this crate in that direction. 207 00:13:22,800 --> 00:13:27,390 And then we could just do zero for the y axis and zero for the z axis. 208 00:13:27,840 --> 00:13:29,940 Then we'll just wait for like five seconds. 209 00:13:29,940 --> 00:13:34,230 So as the crate is falling down the stairs, it's destroying a bunch of stair parts. 210 00:13:34,230 --> 00:13:38,730 And then afterwards we're going to refer to that connection and disconnect it that way we're not listening 211 00:13:38,730 --> 00:13:40,410 for when the crate is touched anymore. 212 00:13:40,590 --> 00:13:43,590 Then we can make the crate anchored again. 213 00:13:44,450 --> 00:13:50,000 And then we're going to set the point light inside of the crate enabled equal to false. 214 00:13:50,000 --> 00:13:53,180 And that means we're actually going to have to enable it in the first place. 215 00:13:53,180 --> 00:13:54,350 So. 216 00:13:54,860 --> 00:13:59,030 When we start the animation and things like that. 217 00:13:59,390 --> 00:14:03,530 Um, actually, when we first get the crate, we can just go here. 218 00:14:04,490 --> 00:14:08,060 And set the point light enabled equal to true. 219 00:14:10,370 --> 00:14:14,840 Another thing that we could do, actually, is we could move this action right here. 220 00:14:14,840 --> 00:14:20,660 So before the players move their camera to the part in the workspace, we want to make sure that we've 221 00:14:20,660 --> 00:14:24,470 actually put the Squidward and we've actually enabled the light on the crate. 222 00:14:24,470 --> 00:14:29,060 So after we enable the light, then we can fire to all the clients to start the stair scene or move 223 00:14:29,060 --> 00:14:30,470 their camera to that part. 224 00:14:30,470 --> 00:14:31,700 Then we push the crate. 225 00:14:31,700 --> 00:14:35,450 The crate destroys a whole bunch of stuff, blah blah blah. 226 00:14:35,450 --> 00:14:40,100 And then after that, when the crate is finished destroying stuff and we've anchored it, then we're 227 00:14:40,100 --> 00:14:44,570 going to use our manipulate cam event and fire to all of the clients to go ahead and reset their cameras 228 00:14:44,570 --> 00:14:45,470 back to their character. 229 00:14:45,470 --> 00:14:49,820 So camera manipulation enum dot two client dot reset camera. 230 00:14:50,980 --> 00:14:54,880 And actually something that's very important about this is that we should do it only to the players 231 00:14:54,880 --> 00:14:56,830 that are in the alive team. 232 00:14:56,830 --> 00:15:02,860 So for every single player in Teams Alive, get players. 233 00:15:02,860 --> 00:15:07,870 Instead, we'll just use this manipulate cam event and fire to a particular client. 234 00:15:07,870 --> 00:15:10,870 So we're just going to loop through different clients. 235 00:15:10,870 --> 00:15:13,150 We'll pass the player and then the action. 236 00:15:13,600 --> 00:15:15,700 So they'll reset all of their cameras. 237 00:15:15,700 --> 00:15:19,540 And then we can use our update guy event and fire to all of the clients. 238 00:15:20,150 --> 00:15:24,020 Now we want to tell them that they fulfilled the objective of entering the basement. 239 00:15:24,020 --> 00:15:26,750 So G actions enum objective fulfilled. 240 00:15:27,660 --> 00:15:33,750 And that fulfilled objective name is equal to go to basement. 241 00:15:35,050 --> 00:15:40,270 And now that means we're going to want to give them a new objective, which is to restore the power 242 00:15:40,270 --> 00:15:44,350 in the basement so it can go back up to where our objectives are stored. 243 00:15:44,350 --> 00:15:46,330 And we're going to create a new one. 244 00:15:46,330 --> 00:15:50,620 So that's going to be restore power. 245 00:15:50,980 --> 00:15:58,570 And we can set the text for this one to be equal to something like figure out how to restore the power. 246 00:15:59,680 --> 00:16:00,430 You just do that? 247 00:16:00,430 --> 00:16:00,760 Why not? 248 00:16:00,760 --> 00:16:04,930 And then we'll have a boolean to keep track of whether or not this was fulfilled. 249 00:16:04,930 --> 00:16:05,320 False. 250 00:16:05,320 --> 00:16:06,490 By default. 251 00:16:06,490 --> 00:16:07,870 We'll go back down. 252 00:16:08,710 --> 00:16:13,120 And then we can use the update GUI event and fire all to the client's GUI actions. 253 00:16:13,120 --> 00:16:14,770 Enum dot add objective. 254 00:16:14,800 --> 00:16:18,790 The objective we would like to add is our restore power. 255 00:16:19,450 --> 00:16:24,100 And then we're going to set the text equal to sections or game sections. 256 00:16:24,100 --> 00:16:29,200 Dot objectives dot restore power and get the text in there. 257 00:16:29,740 --> 00:16:34,660 And then one last time we're going to use our update UI event and fire to all of the clients to give 258 00:16:34,660 --> 00:16:39,040 them some information on how to obtain the flashlight, which is going to be on the floor. 259 00:16:39,040 --> 00:16:45,160 So we can do GUI actions, enum dot, small message, and we're going to want to tell them that they 260 00:16:45,160 --> 00:16:49,450 need to grab the flashlight from the floor. 261 00:16:50,490 --> 00:16:56,220 Now, after this point, basically all of the players cameras have returned back to their characters. 262 00:16:56,220 --> 00:16:58,740 So we'll just wait one second just in case. 263 00:16:58,740 --> 00:17:03,240 But after that, we're going to refer to our Squidward animation handler, and we're going to stop the 264 00:17:03,240 --> 00:17:04,500 animation inside of there. 265 00:17:04,500 --> 00:17:09,750 And then we're just going to set the animated Squidward dot parent equal to server storage and put him 266 00:17:09,750 --> 00:17:12,900 back in the other stuff folder, or you could destroy him as well. 267 00:17:12,900 --> 00:17:14,850 Doesn't really matter either way. 268 00:17:15,180 --> 00:17:15,570 Okay. 269 00:17:15,570 --> 00:17:16,140 And perfect. 270 00:17:16,140 --> 00:17:20,100 We should have everything completed here that we need to test so far. 271 00:17:20,100 --> 00:17:25,110 So let's go ahead and play test the game and check to see if our basement scene is working or not. 272 00:17:25,110 --> 00:17:28,920 All right, it is now time to go ahead and inspect the basement. 273 00:17:28,920 --> 00:17:34,080 So as soon as we touch this invisible part right here, our camera should get moved up to here. 274 00:17:34,080 --> 00:17:38,070 The stairs scene should start and then our camera should move back. 275 00:17:38,070 --> 00:17:40,020 So let's go ahead and see what happens. 276 00:17:40,020 --> 00:17:40,890 So we touch it. 277 00:17:41,190 --> 00:17:42,420 There we go. 278 00:17:43,230 --> 00:17:44,970 We're currently in the stair scene. 279 00:17:45,330 --> 00:17:47,070 The crate gets pushed down. 280 00:17:47,070 --> 00:17:47,550 Spooky. 281 00:17:47,550 --> 00:17:48,960 Squidward is back there. 282 00:17:48,960 --> 00:17:52,140 We get told to grab the flashlight from the floor. 283 00:17:52,140 --> 00:17:54,600 Currently we don't have that scripted, but we'll do that later. 284 00:17:54,720 --> 00:18:00,270 And as you can see, we are no longer able to exit the basement as we're stuck from doing so, our crate 285 00:18:00,270 --> 00:18:05,850 is laying back there, and if we go ahead and look on the server real quick and I go down to the basement 286 00:18:05,850 --> 00:18:09,930 here and let me go ahead and move this character so we can actually see whether or not we broke any 287 00:18:09,930 --> 00:18:10,740 stairs. 288 00:18:11,810 --> 00:18:12,770 Move his light up. 289 00:18:12,770 --> 00:18:13,640 And there you go. 290 00:18:13,640 --> 00:18:18,260 As you can see, a whole bunch of stairs are missing because they all got destroyed by our crate. 291 00:18:18,260 --> 00:18:19,190 Perfect. 292 00:18:19,190 --> 00:18:24,110 So now this is the time where we're going to let our players basically have free reign over the basement. 293 00:18:24,110 --> 00:18:28,220 They're going to get their flashlight, and they're going to explore the basement to figure out how 294 00:18:28,220 --> 00:18:30,290 to restore the power. 295 00:18:30,290 --> 00:18:36,410 So everything is working well except for my animation, because I put in the wrong ID, but that's fine. 296 00:18:36,410 --> 00:18:42,470 So the next thing we can go ahead and script, I think, is the lockers for players to be able to hide 297 00:18:42,470 --> 00:18:47,810 inside of them, because our Squidward AI is going to be pretty ruthless, and we need to give our players 298 00:18:47,810 --> 00:18:51,020 the ability to hide inside of lockers in the map. 299 00:18:51,020 --> 00:18:53,390 So as you can see, I've already placed them around the map. 300 00:18:53,450 --> 00:18:57,680 They have different positions in them, so when the player goes up to the locker, we'll put them inside 301 00:18:57,680 --> 00:19:01,910 and we'll tween them coming out and things like that, and it'll be pretty interesting to see. 302 00:19:01,910 --> 00:19:03,890 So I'll go ahead and see you in the next lecture.